package com.kgc.storeconsumer.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.store.pojo.InventoryProfitDetail;
import com.kgc.store.pojo.OutStore;
import com.kgc.storeconsumer.feign.InventoryProfitDetailFeign;
import com.kgc.storeconsumer.feign.OutStoreFeign;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
@CrossOrigin("*")
@RequestMapping("/inventoryProfitDetail")
public class InventoryProfitDetailController {
    private Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    private InventoryProfitDetailFeign inventoryProfitDetailFeign;

    @RequestMapping("getInventoryProfitDetailList")
    @ResponseBody
    public ResponseMsg getInventoryProfitDetailList(String inventoryProfitCode){
        logger.info("InventoryProfitDetailController getInventoryProfitDetailList inventoryProfitCode:"+inventoryProfitCode);
        ResponseMsg msg =inventoryProfitDetailFeign.getInventoryProfitDetailList(inventoryProfitCode);
        logger.debug("InventoryProfitDetailController getInventoryProfitDetailList msg:"+msg);
        return msg;
    }

    @RequestMapping("delInventoryProfitDetail")
    @ResponseBody
    public ResponseMsg delInventoryProfitDetail(String inventoryProfitCode){
        logger.info("InventoryProfitDetailController delInventoryProfitDetail inventoryProfitCode:"+inventoryProfitCode);
        ResponseMsg msg =inventoryProfitDetailFeign.delInventoryProfitDetail(inventoryProfitCode);
        logger.debug("InventoryProfitDetailController delInventoryProfitDetail msg:"+msg);
        return msg;
    }

    @RequestMapping("insertInventoryProfitDetail")
    @ResponseBody
    ResponseMsg insertInventoryProfitDetail(@RequestBody InventoryProfitDetail inventoryProfitDetail){
        logger.info("InventoryProfitDetailController insertInventoryProfitDetail inventoryProfitDetail:"+inventoryProfitDetail);
        ResponseMsg msg =inventoryProfitDetailFeign.insertInventoryProfitDetail(inventoryProfitDetail);
        logger.debug("InventoryProfitDetailController insertInventoryProfitDetail msg:"+msg);
        return msg;
    }
}
